package to.us.abuzz.net;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;

public class ServerMonitor {
	public static boolean checkPort(String host, int port, int timeout)  {
		Socket s = new Socket();
		try {
			s.connect(new InetSocketAddress(host,port), timeout);
			s.close();
		} catch (IOException e) {
			e.printStackTrace();
			return false;
		}
		return true;
	}
	public static boolean checkPort(String host, int port) {
		return checkPort(host, port, 60000);
	}
}
